package com.itcg.springboot03deptemptest.service.impl;


import com.itcg.springboot03deptemptest.mapper.DeptMapper;
import com.itcg.springboot03deptemptest.pojo.Dept;
import com.itcg.springboot03deptemptest.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    private DeptMapper deptMapper;

    @Override
    public List<Dept> findAll() {
        return deptMapper.findAll();
    }

    @Override
    public Dept findById(Integer id) {
        return deptMapper.findById(id);
    }

    @Override
    @Transactional
    public void inserts(Dept dept) {
        deptMapper.inserts(dept);
    }

    @Override
    @Transactional
    public void deletes(Integer id) {
        deptMapper.deletes(id);
    }

    @Override
    @Transactional
    public void updates(Dept dept) {
        deptMapper.updates(dept);
    }
}
